package gestionTransportObjetsGenerated;

/**
 * Interface definition : GestionTransporteur
 * 
 * @author OpenORB Compiler
 */
public class _GestionTransporteurStub extends org.omg.CORBA.portable.ObjectImpl
        implements GestionTransporteur
{
    static final String[] _ids_list =
    {
        "IDL:gestionTransportObjetsGenerated/GestionTransporteur:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = gestionTransportObjetsGenerated.GestionTransporteurOperations.class;

    /**
     * Operation identifierTransp
     */
    public gestionTransportObjetsGenerated.Transporteur identifierTransp(String numPrest)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("identifierTransp",true);
                    _output.write_string(numPrest);
                    _input = this._invoke(_output);
                    gestionTransportObjetsGenerated.Transporteur _arg_ret = gestionTransportObjetsGenerated.TransporteurHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("identifierTransp",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionTransporteurOperations _self = (gestionTransportObjetsGenerated.GestionTransporteurOperations) _so.servant;
                try
                {
                    return _self.identifierTransp( numPrest);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation inscrirePrestataire
     */
    public String inscrirePrestataire(gestionTransportObjetsGenerated.Transporteur transp)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("inscrirePrestataire",true);
                    gestionTransportObjetsGenerated.TransporteurHelper.write(_output,transp);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("inscrirePrestataire",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionTransporteurOperations _self = (gestionTransportObjetsGenerated.GestionTransporteurOperations) _so.servant;
                try
                {
                    return _self.inscrirePrestataire( transp);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation obtenirPrestataires
     */
    public gestionTransportObjetsGenerated.Transporteur[] obtenirPrestataires()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("obtenirPrestataires",true);
                    _input = this._invoke(_output);
                    gestionTransportObjetsGenerated.Transporteur[] _arg_ret = gestionTransportObjetsGenerated.TransporteursHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("obtenirPrestataires",_opsClass);
                if (_so == null)
                   continue;
                gestionTransportObjetsGenerated.GestionTransporteurOperations _self = (gestionTransportObjetsGenerated.GestionTransporteurOperations) _so.servant;
                try
                {
                    return _self.obtenirPrestataires();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
